package com.yms.juc.lock;

import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

/**
 * @version : 1.0
 * @author: yangmingsong
 * @date: 2022/7/22-07-22-17:19
 * @description: spring5Test 可重入锁
 */
public class ReentrackLock {
    private static ReentrantLock lock = new ReentrantLock();
    public static void main(String[] args) {
        new Thread(()->{
            lock.lock();
            try {
                System.out.println("");
            }finally {
                lock.unlock();
            }
        }).start();
    }

}
